// 存放前端页面的功能函数
//放大镜效果
function magnifyingGlass(container, cover, bigImg) {
    let borderW = parseInt(getComputedStyle(container).borderWidth);
    let containerH = container.offsetHeight - borderW * 2;
    let containerW = container.offsetWidth - borderW * 2;
    container.onmousemove = function (e) {
        let coverH = cover.offsetHeight;
        let coverW = cover.offsetWidth;
        let ratio = containerH / coverH;
        let gapH = containerH - coverH;
        let gapW = containerW - coverW;
        let coverX = e.x - this.offsetLeft - borderW - coverW / 2;
        let coverY = e.y - this.offsetTop - borderW - coverH / 2;
        coverX < 0 && (coverX = 0);
        coverX > gapW && (coverX = gapW);
        coverY < 0 && (coverY = 0);
        coverY > gapH && (coverY = gapH);
        cover.style.left = coverX + "px";
        cover.style.top = coverY + "px";
        bigImg.style.left = -coverX * ratio + "px";
        bigImg.style.top = -coverY * ratio + "px";
    }
}
export {
    magnifyingGlass,
}